package ai.people.netmon.framework.domain.archives.vo;

import ai.people.netmon.framework.domain.archives.entity.ClueArchives;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @author zhenglin
 * @date 2022/5/31
 */
@Data
@NoArgsConstructor
public class ClueListVO {

    /**
     * 线索id
     */
    private String id;
    /**
     * 档案id
     */
    private String archivesId;
    /**
     * 档案照片
     */
    private String archivesPicture;

    /**
     * 标签
     */
    private List<String> tags;

    /**
     * 名字
     */
    private String name;

    /**
     * 个人信息
     */
    private String info;
    /**
     * 身份证
     */
    private String idNumber;

    /**
     * 手机号
     */
    private String phoneNumber;

    /**
     * 车牌号
     */
    private String plateNumber;

    /**
     * 创建时间
     */
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /**
     * 社交账号信息
     */
    private List<Map<String,String>> social;

    /**
     * 电子邮箱
     */
    private String emailInfo;

    /**
     * 已分享用户账号
     */
    private String sharedUsers;
    /**
     * 创建者账号
     */
    private String creatorName;

    public ClueListVO(ClueArchives record) {
        this.id = String.valueOf(record.getId());
        this.archivesId = String.valueOf(record.getArchivesId());
        this.tags = record.buildTags();
        this.name = record.buildFirstName();
        this.archivesPicture = record.getPicture();
        this.info = record.buildInfo();
        this.idNumber = record.buildHideIdNumber();
        this.phoneNumber = record.buildHidePhone();
        this.plateNumber = record.buildHidePlate();
        this.createTime = record.getCreateTime();
        this.social = record.buildSocialInfo();
        this.emailInfo = record.buildSocialEmail();
        this.sharedUsers = record.buildSharedUsers();
        this.creatorName = record.getCreatorName();
    }
}
